package gateway.dtos;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class GatewayApi {

    @NotBlank(message = "id不能空")
    private String id;  //对应swagger中的服务名称

    @NotBlank(message = "path不能为空")
    private String path; // 访问zuul的路径

    private String serviceId; //eureka上注册的id，即转发的服务

    @NotBlank(message = "url不能为空")
    private String url; // 转发的路径

    @Range(min = 0,max = 1)
    private int stripPrefix;

    @Range(min = 0,max = 1)
    private int retryAble;

    @Range(min = 0,max = 1)
    private int enabled;
}
